//2009/08/27 00:47:36
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class VariableSpeedLimit
{
public:
    double journeyTime(int journeyLength, vector <int> speedLimit)
    {
		double time = 0.0;
		for(int i=0; journeyLength >0; )
		{
			if(journeyLength >= speedLimit[i])
			{
				journeyLength -= speedLimit[i];
				time += 1.0;
			}
			else
			{
				time += 1.0 * journeyLength / speedLimit[i];
				journeyLength = 0;
			}
			i = (i+1) % speedLimit.size();
		}
		return time;
    }
};
